<html>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<title>HelloWorld</title>
<header></header>

<body>
    <div id="identify">
        <button v-on:click="show">按钮</button>
        <button v-on:mouseover="add">Add</button>
        {{arr}}
    </div>
    <script>
        window.onload = function () {
            var app = new Vue({
                el: '#identify',
                data: {
                    arr: [1, 2, 3, 4, 5]
                },
                methods: {
                    show: function () {
                        console.log('show 方法');
                    },
                    add: function () {
                        //使用this访问当前实例中的成员
                        this.arr.push(666);
                    }
                }
            })
        }

    </script>
</body>

</html>